feat(view): unify lockedRepos and preserve empty-repo state#70
Merged
wgordon17 merged 7 commits intoApr 17, 2026
Merged
Conversation
- Flatten lockedRepos from per-tab object to shared z.array(z.string()) - Add migrateLockedRepos() with shape-based detection and lastActiveTab dedup precedence for backward-compatible localStorage migration - Remove tab parameter from lockRepo, unlockRepo, moveLockedRepo, pruneLockedRepos; remove LockedReposTab type - Add configRepoNames memo in DashboardPage (selectedRepos + upstreamRepos + monitoredRepos) for config-derived pruning - Pass configRepoNames to IssuesTab, PullRequestsTab, ActionsTab as optional prop with item-derived fallback - Remove tab prop from RepoLockControls - Update USER_GUIDE pin state docs from per-tab to cross-tab shared - Add 11 new tests: 5 migrateLockedRepos unit tests, 6 empty-repo state preservation tests across 3 dashboard tab test files
- Guard against non-object JSON.parse results (primitives, arrays, null) before casting to Record in loadViewState migration path - Add LOCKED_REPOS_CAP (50) and .max(200) string constraint for defense-in-depth consistency with ignoredItems/trackedItems caps
- Slice migrateLockedRepos result to LOCKED_REPOS_CAP (50) to prevent merged per-tab arrays exceeding Zod .max(50) and wiping view state - Guard lockRepo push with length < LOCKED_REPOS_CAP to prevent runtime accumulation beyond schema limit
An oversized lockedRepos array (>50 entries) that bypasses migration (already in array format) would fail .max(LOCKED_REPOS_CAP) and cause safeParse to reject the entire ViewState, wiping all user settings. Truncate before validation to prevent total state loss.
- Test migrateLockedRepos with actions as preferred tab (full ordering) - Test >50 merged entries capped at LOCKED_REPOS_CAP (regression guard for data-loss bug where oversized array fails Zod .max()) - Test lockRepo silently no-ops at cap boundary
- API smoke tests now include Origin header (WAF correctly blocks /api/* without Origin for CSRF protection) - Adds explicit test that bare /api/health is blocked (403) - Reduces parallel jobs from 10 to 2 with 300ms delay to prevent WAF rate-limit timeouts causing flaky false failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary